//
//  BCIndustryScreeningYieldView.m
//  GSBlockChain
//
//  Created by guoshikeji_a on 2018/11/19.
//  Copyright © 2018年 guoshikeji. All rights reserved.
//

#import "BCIndustryScreeningYieldView.h"
//
#import "BCIndustryScreeningYieldSliderView.h"


@interface BCIndustryScreeningYieldView ()

@property (nonatomic, strong) BCIndustryScreeningYieldSliderView *sliderView;

@end

@implementation BCIndustryScreeningYieldView

- (instancetype)init
{
    self = [super init];
    if (self) {
        [self setupSubviews];
    }
    return self;
}
- (void)setupSubviews {
    self.customTitleLabel.text = nil;
    //
    self.sliderView = [BCIndustryScreeningYieldSliderView new];
    [self addSubview:self.sliderView];
    [self.sliderView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.customTitleLabel.mas_bottom);
        make.left.mas_equalTo(self).offset(BCIndustryScreeningBaseLeftPadding);
        make.right.mas_equalTo(self).offset(-BCIndustryScreeningBaseLeftPadding);
        make.height.mas_equalTo([BCIndustryScreeningYieldSliderView defaultHeight]);
    }];
}

- (void)setMinValue:(CGFloat)minValue maxValue:(CGFloat)maxValue {
    [self.sliderView setMinValue:minValue maxValue:maxValue];
}

- (CGFloat)leftRangeValue {
    return self.sliderView.currentMinValue;
}
- (CGFloat)rightRangeValue {
    return self.sliderView.currentMaxValue;
}


- (CGFloat)viewHeight {
    CGFloat height = [super viewHeight];
    height += [BCIndustryScreeningYieldSliderView defaultHeight];
    return height;
}

@end
